package com.arofoxmsn.model.profile;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import com.arofoxmsn.model.comunication.AbstractComunicationMedia;
import com.arofoxmsn.model.friendship.FriendshipConfiguration;

@Entity
public class Profile {
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "id", unique = true, nullable = false)
	private double id;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private PersonalData personalData;
	
	private String picture;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private FriendshipConfiguration defaultConfiguration;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private RelationshipStatus relationshipStatus;
	
	@OneToMany(targetEntity=AbstractComunicationMedia.class, mappedBy="profile",cascade=CascadeType.ALL, fetch=FetchType.EAGER)
	private List<AbstractComunicationMedia> comunicationMedia = new ArrayList<AbstractComunicationMedia>();
	
	private Calendar createdAt;
	
	private Calendar updatedAt;
	
	
	//Setters and Getters
	public double getId() {return id;}
	public void setId(double id) {this.id = id;}
	
	public PersonalData getPersonalData() {return personalData;}
	public void setPersonalData(PersonalData personalData) {this.personalData = personalData;}
	
	public String getPicture() {return picture;}
	public void setPicture(String picture) {this.picture = picture;}
	
	public FriendshipConfiguration getDefaultConfiguration() {return defaultConfiguration;}
	public void setDefaultConfiguration(FriendshipConfiguration defaultConfiguration) {this.defaultConfiguration = defaultConfiguration;}
	
	public RelationshipStatus getRelationshipStatus() {return relationshipStatus;}
	public void setRelationshipStatus(RelationshipStatus relationshipStatus) {this.relationshipStatus = relationshipStatus;}
	
	public List<AbstractComunicationMedia> getComunicationMedia() {return comunicationMedia;}
	public void setComunicationMedia(
			List<AbstractComunicationMedia> comunicationMedia) {
		this.comunicationMedia = comunicationMedia;
	}
	
	public Calendar getCreatedAt() {return createdAt;}
	public void setCreatedAt(Calendar createdAt) {this.createdAt = createdAt;}
	
	public Calendar getUpdatedAt() {return updatedAt;}
	public void setUpdatedAt(Calendar updatedAt) {this.updatedAt = updatedAt;}
	
}
